﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AzureGames.Domain.Models
{
    public class GamePlayOptions
    {
        public GamePlayOptions(Model.GameDefinition game, GamePlayer player, List<GamePlayer> aiPlayers, List<GamePlayer> challengePlayers, List<GamePlayer> contactPlayers, List<string> messages, List<ActiveGame> activeGames)
        {
            Name = game.Name;
            ID = game.ID;
            Instructions = game.Instructions;
            AIPlayers = aiPlayers;
            ChallengePlayers = challengePlayers;
            ContactPlayers = contactPlayers;
            Messages = messages;
            CurrentPlayer = player;
            ActiveGames = activeGames;

            // TODO: this will need to be a bit smarter but for now...
            IsTwoPlayer = game.RequiredNumberOfPlayers == 2;

        }

        public string Name { get; set; }
        public int ID { get; set; }
        /// <summary>
        /// A description of the game and how it is played
        /// </summary>
        public string Instructions { get; set; }

        public bool IsAuthenticated { get { return CurrentPlayer.ID != Guid.Empty.ToString(); } }
        public bool IsTwoPlayer { get; set; }

        public GamePlayer CurrentPlayer { get; set; }
        
        /// <summary>
        /// A collection of the AI opponents that this user can play against
        /// </summary>        
        public List<GamePlayer> AIPlayers { get; set; }
        /// <summary>
        /// A collection of the opponents that this user can play against
        /// </summary>
        /// <remarks>This will represent a collection of players ranked higher than the opponent</remarks>
        public List<GamePlayer> ChallengePlayers { get; set; }
        /// <summary>
        /// A collection of contacts that this user can play against
        /// </summary>        
        public List<GamePlayer> ContactPlayers { get; set; }
        /// <summary>
        /// A collection of messages to be displayed to the user
        /// </summary>
        public List<string> Messages { get; set; }
        public List<ActiveGame> ActiveGames { get; set; }
    }
}
